package uit.shoeshop.action;
import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;


import uit.shoeshop.model.AjaxcartModel;

import com.opensymphony.xwork2.ActionSupport;


public class AjaxgetcartAction extends ActionSupport implements ServletRequestAware,ServletResponseAware{
	private static final long serialVersionUID = 1L;
	private HttpServletRequest request;
	private HttpServletResponse response;

	private String responseAjax;
	@Override
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}
	
    public String execute() throws Exception {
		AjaxcartModel ajax = new AjaxcartModel();
    	setResponseAjax(ajax.getCart(request));
        return SUCCESS;
    }

	public void setResponseAjax(String responseAjax) {
		this.responseAjax = responseAjax;
	}

	public String getResponseAjax() {
		return responseAjax;
	}
}
